﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace YJKArch.AreaStatistical.Statistical
{
	public partial class ArchAreaStatisticalForm : System.Windows.Forms.Form
	{
		public ArchAreaStatisticalForm(ArchAreaStatisticalData data)
		{
			this.m_Data = data;
			this.InitializeComponent();
		}

		private void StatisticalResultForm_Load(object sender, EventArgs e)
		{
			this.AddItems();
		}

		private void AddItems()
		{
			System.Drawing.Color lightGray = System.Drawing.Color.LightGray;
			System.Drawing.Color lightGray2 = System.Drawing.Color.LightGray;
			this.treeListView.Sorting = SortOrder.None;
			for (int i = 0; i < this.m_Data.m_Data.Count; i++)
			{
				ArchAreaStatisticalFloorData archAreaStatisticalFloorData = this.m_Data.m_Data[i];
				TreeListViewItem parent = TreeListViewEditor.AddRootItem(archAreaStatisticalFloorData.m_FloorName, 0, this.treeListView);
				for (int j = 0; j < archAreaStatisticalFloorData.m_Data.Count; j++)
				{
					ArchAreaStatisticalRowData archAreaStatisticalRowData = archAreaStatisticalFloorData.m_Data[j];
					TreeListViewItem parent2 = TreeListViewEditor.AddItem(archAreaStatisticalRowData.m_HoomNumbName, 1, parent);
					TreeListViewEditor.AddColumnItems(archAreaStatisticalRowData.ToStrList(), 1, parent2, lightGray);
				}
				TreeListViewItem parent3 = TreeListViewEditor.AddItem("合计", 1, parent);
				TreeListViewEditor.AddColumnItems(archAreaStatisticalFloorData.m_FloorFooting.ToStrList(), 1, parent3, lightGray2);
			}
			TreeListViewItem parent4 = TreeListViewEditor.AddRootItem("合计", 1, this.treeListView);
			TreeListViewEditor.AddColumnItems(this.m_Data.m_Footing.ToStrList(), 1, parent4, lightGray2);
		}

		private ArchAreaStatisticalData m_Data;
	}
}
